package com.heima.wemedia.listener;

import com.alibaba.fastjson.JSON;
import com.heima.model.wemedia.pojos.WmNews;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class KafkaListenerDemo {

    @KafkaListener(topics = "topic1")
    public void test(String msg){
        WmNews wmNews= JSON.parseObject(msg,WmNews.class);
        System.out.println(wmNews);
    }
}
